var xhrObject;
var xhrObject2;

$(document).ready(function(){ // 페이지가 로딩이 완료되면(이미지제외)  
  
	$("#aaa").click(function(){  
          $("#hide_div").show() ; 
          $("#hide_div2").hide() ;
          $("#hide_div3").hide() ;
     });  
    $("#bbb").click(function(){  
        $("#hide_div2").show() ;
        $("#hide_div").hide() ; 
        $("#hide_div3").hide() ;
   });  
    $("#ccc").click(function(){  
        $("#hide_div3").show() ;
        $("#hide_div").hide() ;  
        $("#hide_div2").hide() ;
   });  
});

function createXHR(){
	
	if(window.ActiveXObject){
		
		xhrObject = new ActiveXObject("Microsoft.XMLHTTP");
		
	}else if(window.XMLHttpRequest){
		
		xhrObject = new XMLHttpRequest();
	}
}


function bbb(){
	
	document.getElementById("ccc_photo2").innerHTML="";
	
	createXHR();
	xhrObject.onreadystatechange=resultProcess2;
	
	xhrObject.open("post","/KOMORIUTA/PhotoOldAction.do?action=pt_old_list_main" ,"true");
	xhrObject.send(null);

}

function ccc(){
	document.getElementById("ccc_photo3").innerHTML="";
	
	createXHR();
	xhrObject.onreadystatechange=resultProcess3;
	
	xhrObject.open("post","/KOMORIUTA/PhotoFreeAction.do?action=pt_free_list_main" ,"true");
	xhrObject.send(null);

}

function ddd(){
	 
	
	
	createXHR();
	xhrObject.onreadystatechange=resultProcess1; 
	
	xhrObject.open("post","/KOMORIUTA/PhotoFreeAction.do?action=pt_free_list_main" ,"true");
	xhrObject.send(null);
}

function eee(){
	//alert("eee");
	document.getElementById("ccc_board1").innerHTML="";
	
	createXHR();
	xhrObject.onreadystatechange=resultProcess4; 
	
	xhrObject.open("post","/KOMORIUTA/FreeBoardAction.do?action=cm_free_list_main" ,"true");
	xhrObject.send(null);
}
function fff(){

	document.getElementById("ccc_board2").innerHTML="";
	
	createXHR();
	xhrObject.onreadystatechange=resultProcess5; 
	
	xhrObject.open("post","/KOMORIUTA/BCBoardAction.do?action=cm_bc_list_main" ,"true");
	xhrObject.send(null);
}

function resultProcess1(){ 
	if(xhrObject.readyState==4){
		if(xhrObject.status==200){
	
		 document.getElementById("ccc_photo1").innerHTML=xhrObject.responseText;	
		// document.documentElement.scrollTop=BodyTop;
	
		}
	}
	
}
function resultProcess2(){
	if(xhrObject.readyState==4){
		if(xhrObject.status==200){
		 document.getElementById("ccc_photo2").innerHTML=xhrObject.responseText;	
		// document.documentElement.scrollTop=BodyTop;
		}
	}
}
function resultProcess3(){
	if(xhrObject.readyState==4){
		if(xhrObject.status==200){
		 document.getElementById("ccc_photo3").innerHTML=xhrObject.responseText;	
		// document.documentElement.scrollTop=BodyTop;
		}
	}
}
function resultProcess4(){
	if(xhrObject.readyState==4){
		if(xhrObject.status==200){
		 document.getElementById("ccc_board1").innerHTML=xhrObject.responseText;	
		// document.documentElement.scrollTop=BodyTop;
		}
	}
}
function resultProcess5(){
	if(xhrObject.readyState==4){
		if(xhrObject.status==200){
		 document.getElementById("ccc_board2").innerHTML=xhrObject.responseText;	
		// document.documentElement.scrollTop=BodyTop;
		}
	}
}

function young_list(){
	var id = $("#idvalue").val();
	if(id=="admin"){
		alert("会員加入してください");
		return;
	}
	location.href="/KOMORIUTA/PhotoYoungAction.do?action=pt_young_list&nick="+id;
}

function old_list(){
	var id = $("#idvalue").val();
	if(id=="admin"){
		alert("会員加入してください");
		return;
	}
	location.href= "/KOMORIUTA/PhotoOldAction.do?action=pt_old_list&nick="+id;
}
function pt_free_list(){
	var id = $("#idvalue").val();
	if(id=="guest"){
		alert("会員加入してください");
		return;
	}
	location.href="/KOMORIUTA/PhotoFreeAction.do?action=pt_free_list&nick="+id;
}
function cm_free_list(){
	var id = $("#idvalue").val();
	if(id=="guest"){
		alert("会員加入してください");
		return;
	}
	location.href="/KOMORIUTA/FreeBoardAction.do?action=cm_free_list&nick="+id;
}
function cm_bc_list(){
	var id = $("#idvalue").val();
	if(id=="guest"){
		alert("会員加入してください");
		return;
	}
	location.href="/KOMORIUTA/BCBoardAction.do?action=cm_bc_list&nick="+id;
}

function Admin_check(a){
	if(a=="admin"){
		alert("会員加入してください");
		return;
	}
}
